<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <title>清分历史 - 租房宝金融管理平台</title>
  
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">清分历史</h3>
       </header>
       <form method="post" action="${ctx}/distribution/history/search"> 

         <div class="row">

           <div class="col-xs-6">

             <!-- <div class="input-daterange-title pull-left col-sm-3"></div> -->

             <div class="input-daterange input-group">
                <span class="input-group input-group-addon">核销时间</span>
               <input type="text" class="form-control" name="start" value="${start}" />
               <span class="input-group-addon">至</span>
               <input type="text" class="form-control" name="end" value="${end}"/>

             </div>

           </div>
                          
           <div class="col-xs-4">
             
             <div class="input-group pull-left">
               <span class="input-group-addon" id="basic-addon1">保理合同编号</span>
               <input type="text" class="form-control" name="contractNo" value="${contractNo}" placeholder="输入编号" aria-describedby="basic-addon1">
             </div>

           </div>
           
           <div class="col-xs-2">
             <div class="btn-group pull-right">
               <button class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" ><i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;查询核销数据</button>
             </div>
           
           </div>

         </div>

       </form>
       <c:if test="${not empty infoMessage}">
            <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
              <fmt:message key="${infoMessage}" />
            </div>
       </c:if>

      <h4>核销信息</h4>
      <div class="table-area">
        <table class="data-list">
          <thead>
            <tr>
              <th>序号</th>
              <th>保理合同</th>
              <th>核销日期</th>
              <th>核销金额</th>
              <th>核销利息</th>
              <th>核销本金</th>
              <th>核销笔数</th>
              <th>备注</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <c:forEach var="settleRecord" items="${settleRecords}" varStatus="status">
              <tr>
                <td>${status.index + 1}</td>
                <td>${settleRecord.factoringContract.contractNo}</td>
                <td><fmt:formatDate value="${settleRecord.settleAt}" pattern="yyyy-MM-dd" /></td>
                <td>
                    <fmt:formatNumber type="currency" value="${settleRecord.totalPayMoney}" />
                </td>
                <td>
                    <fmt:formatNumber type="currency" value="${settleRecord.totalPayInt}" />
                </td>
                <td>
                    <fmt:formatNumber type="currency" value="${settleRecord.totalPayOstdAmt}" />
                
                </td>

                <td>${settleRecord.settleItemList.size()}</td>
                <td>${settleRecord.comment}</td>
                <td>
                  <a href="${ctx}/distribution/history/${settleRecord.id}/detail" class="hover-no-text-decoration" title="查看详情">查看详情</a>
                  <c:if test="${not empty data.getLastSettleRecord(settleRecord.id) && principal.authority ne 'ROLE_APP'}"><a href="${ctx}/distribution/${settleRecord.id}/cancel" class="hover-no-text-decoration" title="撤销核销" data-target="#" data-toggle="modal" >撤销核销</a></c:if>                    
                </td>
              </tr>
            </c:forEach>        
          </tbody>
        </table>
	      <jsp:include page="/WEB-INF/include/page.jsp">
	        <jsp:param value="distribution/history" name="url" />
	      </jsp:include>
      </div>


       <%-- <%@ include file="/WEB-INF/include/footer.jsp"%> --%>
       
    </div>

  </div>
  
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>

  <script src="${ctx.resource}/js/bootstrap-datepicker.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datepicker.zh-CN.js"></script>

  <script type="text/javascript">

    $('.input-daterange').datepicker({
        format: "yyyy-mm-dd",
        todayBtn: "linked",
        language: "zh-CN",
        orientation: "top left",
        autoclose: true,
        todayHighlight: true
      });

  </script>
  
  
</body>
</html>
